import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Login from './views/Login.vue'
import Regist from './views/Regist.vue'
import HomeUsers from './views/HomeUsers.vue'
import HomeMenus from './views/HomeMenus.vue'
import HomeUsersAdd from './views/HomeUsersAdd.vue'
import HomeUsersEdit from './views/HomeUsersEdit.vue'
import HomeMenusAdd from './views/HomeMenusAdd.vue'
import HomeMenusEdit from './views/HomeMenusEdit.vue'
import HomeOutlines from './views/HomeOutlines.vue'
import HomeOutlinesEdit from './views/HomeOutlinesEdit.vue'
import HomeOutlinesAdd from './views/HomeOutlinesAdd.vue'
import HomeItems from './views/HomeItems.vue'
import HomeItemsAdd from './views/HomeItemsAdd.vue'
import HomeItemsEdit from './views/HomeItemsEdit.vue'
import HomeClasses from './views/HomeClasses.vue'
import HomeClassesAdd from './views/HomeClassesAdd.vue'
import HomeClassesEdit from './views/HomeClassesEdit.vue'
import HomePapers from "./views/HomePapers.vue"
import HomePapersAdd from "./views/HomePapersAdd.vue"
import HomePapersEdit from "./views/HomePapersEdit.vue"
import PapersRelease from "./views/PapersRelease.vue"
import PaperAnalysis from "./views/PaperAnalysis.vue"

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/home',
      name: 'Home',
      component: Home,
      redirect: '/home/users',
      children: [
        {
          path: 'users',
          name: 'HomeUsers',
          component: HomeUsers
        },
        {
          path: 'users/add',
          name: 'HomeUsersAdd',
          component: HomeUsersAdd,
        },
        {
          path: 'users/edit/:id',
          name: 'HomeUsersEdit',
          component: HomeUsersEdit,
          props: true
        },
        {
          path: 'menus',
          name: 'HomeMenus',
          component: HomeMenus,
          props: true
        },
        {
          path: 'menus/add/:id',
          name: 'HomeMenusAdd',
          component: HomeMenusAdd,
          props: true,
        },
        {
          path: 'menus/edit/:id',
          name: 'HomeMenusEdit',
          component: HomeMenusEdit,
          props: true,
        },
        {
          path: 'outlines',
          name: 'HomeOutlines',
          component: HomeOutlines,
          props: true
        },
        {
          path: 'outlines/edit/:id',
          name: 'HomeOutlinesEdit',
          component: HomeOutlinesEdit,
          props: true
        },
        {
          path: 'outlines/add/:id',
          name: 'HomeOutlinesAdd',
          component: HomeOutlinesAdd,
          props: true
        },
        {
          path: 'items',
          name: 'HomeItems',
          component: HomeItems,
          props: true,
        },
        {
          path: 'items/add/:id',
          name: 'HomeItemsAdd',
          component: HomeItemsAdd,
          props: true,
        },
        {
          path: 'items/edit/:id',
          name: 'HomeItemsEdit',
          component: HomeItemsEdit,
          props: true
        },
        {
          path: 'classes',
          name: 'HomeClasses',
          component: HomeClasses,
          props: true
        },
        {
          path: 'classes/add/:id',
          name: 'HomeClassesAdd',
          component: HomeClassesAdd,
          props: true
        },
        {
          path: 'classes/edit/:id',
          name: 'HomeClassesEdit',
          component: HomeClassesEdit,
          props: true
        },
        {
          path: "papers",
          name: "HomePapers",
          component: HomePapers,
          props: true
        },
        {
          path: "papers/add",
          name: "HomePapersAdd",
          component: HomePapersAdd,
          props: true
        },
        {
          path: "papers/edit/:id",
          name: "HomePapersEdit",
          component: HomePapersEdit,
          props: true
        },
      ]
    },
    {
      path: "/papers/release/:id",
      name: "PapersRelease",
      component: PapersRelease,
      props: true
    },
    {
      path: "/paper/analysis/:id",
      name: "PaperAnalysis",
      component: PaperAnalysis,
      props: true

    },
    {
      path: '/login/',
      name: 'Login',
      component: Login,
    },
    {
      path: '/regist',
      name: 'Regist',
      component: Regist,
    },
    {
      path: '*',
      redirect: '/login',
      component: Login
    },
  ]
})
